<!DOCTYPE html>
<!-- 
Template Name:  SmartAdmin Responsive WebApp - Template build with Twitter Bootstrap 4
Version: 4.0.0
Author: Sunnyat Ahmmed
Website: http://gootbootstrap.com
Purchase: https://wrapbootstrap.com/theme/smartadmin-responsive-webapp-WB0573SK0
License: You must have a valid license purchased only from wrapbootstrap.com (link above) in order to legally use this theme for your project.
-->
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>
            Saving to Database - Theme Settings - SmartAdmin v4.0.1
        </title>
        <meta name="description" content="Saving to Database">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no, minimal-ui">
        <!-- Call App Mode on ios devices -->
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <!-- Remove Tap Highlight on Windows Phone IE -->
        <meta name="msapplication-tap-highlight" content="no">
        <!-- base css -->
        <link rel="stylesheet" media="screen, print" href="../css/vendors.bundle.css">
        <link rel="stylesheet" media="screen, print" href="../css/app.bundle.css">
        <!-- Place favicon.ico in the root directory -->
        <link rel="apple-touch-icon" sizes="180x180" href="../img/favicon/apple-touch-icon.png">
        <link rel="icon" type="image/png" sizes="32x32" href="../img/favicon/favicon-32x32.png">
        <link rel="mask-icon" href="../img/favicon/safari-pinned-tab.svg" color="#5bbad5">
        <link rel="stylesheet" media="screen, print" href="../css/theme-demo.css">
    </head>
    <body class="mod-bg-1 ">
        <!-- BEGIN Page Wrapper -->
        <div class="page-wrapper">
            <div class="page-inner">
                <!-- END Left Aside -->
                <div class="page-content-wrapper">
                    <!-- BEGIN Page Content -->
                    <!-- the #js-page-content id is needed for some plugins to initialize -->
                    <main id="js-page-content" role="main" class="page-content">
                        <div class="subheader">
                            <h1 class="subheader-title">
                                Theme Settings: <span class='fw-300'>Saving to Database</span>
                                <small>
                                    How to save and load settings from database
                                </small>
                            </h1>
                        </div>
                        <div class="row">
                            <div class="col-xl-12">
                                <div id="panel-1" class="panel">
                                    <div class="panel-hdr">
                                        <h2>
                                            Test <span class="fw-300"><i>it out!</i></span>
                                        </h2>
                                        <div class="panel-toolbar">
                                            <button class="btn btn-panel" data-action="panel-collapse" data-toggle="tooltip" data-offset="0,10" data-original-title="Collapse"></button>
                                            <button class="btn btn-panel" data-action="panel-fullscreen" data-toggle="tooltip" data-offset="0,10" data-original-title="Fullscreen"></button>
                                            <button class="btn btn-panel" data-action="panel-close" data-toggle="tooltip" data-offset="0,10" data-original-title="Close"></button>
                                        </div>
                                    </div>
                                    <div class="panel-container show">
                                        <div class="panel-content">
                                            <div class="panel-tag">
                                                All changes are stored to localStorage by default. <strong>pushSettings()</strong> inherits this trait. Set <code>"storeLocally"</code> to <strong>false</strong> via <strong>app.config.js</strong> to disable this action.
                                            </div>
                                            <div class="row">
                                                <div class="col-xl-6 order-2 order-xl-1">
                                                    <div class="form-group">
                                                        <label for="pushSettings_input">
                                                            <strong>Push Settings</strong>
                                                        </label>
                                                        <div class="input-group">
                                                            <input type="text" id="pushSettings_input" list="css_list" name="pushSettings_input" class="form-control" placeholder="e.g. header-function-fixed nav-function-fixed">
                                                            <datalist id="css_list">
                                                                <option value="header-function-fixed">
                                                                <option value="nav-function-fixed">
                                                                <option value="nav-function-minify">
                                                                <option value="nav-function-hidden">
                                                                <option value="nav-function-top">
                                                                <option value="mod-main-boxed">
                                                                <option value="nav-mobile-push">
                                                                <option value="nav-mobile-no-overlay">
                                                                <option value="nav-mobile-slide-out">
                                                                <option value="mod-bigger-font">
                                                            </datalist>
                                                            <div class="input-group-append">
                                                                <button class="btn btn-secondary btn-w-m" type="button" id="pushSettings_btn">push()</button>
                                                            </div>
                                                        </div>
                                                        <div class="help-block">
                                                            $.ajax({ .. success: function (data) { var DataBase_str = data[i].appSettings } .. }); initApp.pushSettings( DataBase_str );
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label for="getSettings_input">
                                                            <strong>Get Settings</strong>
                                                        </label>
                                                        <div class="input-group">
                                                            <input type="text" id="getSettings_input" name="getSettings_input" readonly="readonly" class="form-control" placeholder="filters and returns nav-*, header-*, mod-*, & display-*">
                                                            <div class="input-group-append">
                                                                <button class="btn btn-secondary btn-w-m" type="button" id="getSettings_btn">get()</button>
                                                            </div>
                                                        </div>
                                                        <div class="help-block">
                                                            var DataBase_str = initApp.getSettings(); $.ajax({ data: {DataBase_str}, dataType: "json" ... })
                                                        </div>
                                                    </div>
                                                    <hr class="my-5">
                                                    <button class="btn btn-outline-danger mr-1" type="button" data-action="app-reset"><u>R</u>eset Settings</button>
                                                    <button class="btn btn-outline-success" type="button" id="ng_eventlog_clear"><u>C</u>lear Events</button>
                                                </div>
                                                <div class="col-xl-6 order-1 order-xl-1">
                                                    <div id="app-eventlog" class="alert alert-primary p-1 h-auto mb-4 mb-xl-0"></div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </main>
                    <!-- this overlay is activated only when mobile menu is triggered -->
                    <div class="page-content-overlay" data-action="toggle" data-class="mobile-nav-on"></div> <!-- END Page Content -->

                    <!-- BEGIN Page Footer -->
                    <footer class="page-footer" role="contentinfo">
                        <div class="d-flex align-items-center flex-1 text-muted">
                            <span class="hidden-md-down fw-700">2019 © SmartAdmin by&nbsp;<a href='https://www.gotbootstrap.com' class='text-primary fw-500' title='gotbootstrap.com' target='_blank'>gotbootstrap.com</a></span>
                        </div>
                        <div>
                            <ul class="list-table m-0">
                                <li><a href="intel_introduction.html" class="text-secondary fw-700">About</a></li>
                                <li class="pl-3"><a href="info_app_licensing.html" class="text-secondary fw-700">License</a></li>
                                <li class="pl-3"><a href="info_app_docs.html" class="text-secondary fw-700">Documentation</a></li>
                                <li class="pl-3 fs-xl"><a href="https://wrapbootstrap.com/user/MyOrange" class="text-secondary" target="_blank"><i class="fal fa-question-circle" aria-hidden="true"></i></a></li>
                            </ul>
                        </div>
                    </footer>
                    <!-- END Page Footer -->

                    <!-- BEGIN Shortcuts -->
                    <!-- modal shortcut -->
                    <div class="modal fade modal-backdrop-transparent" id="modal-shortcut" tabindex="-1" role="dialog" aria-labelledby="modal-shortcut" aria-hidden="true">
                        <div class="modal-dialog modal-dialog-top modal-transparent" role="document">
                            <div class="modal-content">
                                <div class="modal-body">
                                    <ul class="app-list w-auto h-auto p-0 text-left">
                                        <li>
                                            <a href="intel_introduction.html" class="app-list-item text-white border-0 m-0">
                                                <div class="icon-stack">
                                                    <i class="base base-7 icon-stack-3x opacity-100 color-primary-500 "></i>
                                                    <i class="base base-7 icon-stack-2x opacity-100 color-primary-300 "></i>
                                                    <i class="fal fa-home icon-stack-1x opacity-100 color-white"></i>
                                                </div>
                                                <span class="app-list-name">
                                                    Home
                                                </span>
                                            </a>
                                        </li>
                                        <li>
                                            <a href="page_inbox_general.html" class="app-list-item text-white border-0 m-0">
                                                <div class="icon-stack">
                                                    <i class="base base-7 icon-stack-3x opacity-100 color-success-500 "></i>
                                                    <i class="base base-7 icon-stack-2x opacity-100 color-success-300 "></i>
                                                    <i class="ni ni-envelope icon-stack-1x text-white"></i>
                                                </div>
                                                <span class="app-list-name">
                                                    Inbox
                                                </span>
                                            </a>
                                        </li>
                                        <li>
                                            <a href="intel_introduction.html" class="app-list-item text-white border-0 m-0">
                                                <div class="icon-stack">
                                                    <i class="base base-7 icon-stack-2x opacity-100 color-primary-300 "></i>
                                                    <i class="fal fa-plus icon-stack-1x opacity-100 color-white"></i>
                                                </div>
                                                <span class="app-list-name">
                                                    Add More
                                                </span>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div> <!-- END Shortcuts -->
                </div>
            </div>
        </div>
        <!-- END Page Wrapper -->
        <!-- base vendor bundle:
			 DOC: if you remove pace.js from core please note on Internet Explorer some CSS animations may execute before a page is fully loaded, resulting 'jump' animations 
						+ pace.js (recommended)
						+ jquery.js (core)
						+ jquery-ui-cust.js (core)
						+ popper.js (core)
						+ bootstrap.js (core)
						+ slimscroll.js (extension)
						+ app.navigation.js (core)
						+ ba-throttle-debounce.js (core)
						+ waves.js (extension)
						+ smartpanels.js (extension)
						+ src/../jquery-snippets.js (core) -->
        <script src="../js/vendors.bundle.js"></script>
        <script src="../js/app.bundle.js"></script>
        <script src="../js/lm/lm.js"></script>
        
        <script type="text/javascript">
            var ng_eventlog = function()
            {

                if ($('#app-eventlog').length)
                {

                    var dt = new Date(),
                        time = "<div class='p-1'><span class='badge badge-primary fw-500 rounded-0'>" + dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds() + " </span> <i>body class changed to: </i>";
                    $('#app-eventlog').prepend(time + "<strong> [ " + initApp.getSettings().split(' ') + " ] </strong>" + "</div/>");

                }

            };

            var ng_eventlog_clear = function()
            {
                $('#app-eventlog').empty();
            }

            var ng_pushSettings = function()
            {
                if ($('#pushSettings_input').val())
                {
                    initApp.pushSettings($('#pushSettings_input').val());
                    $('#pushSettings_input').val('');
                    ng_eventlog();
                }
            }

            var ng_getSettings = function()
            {
                var getSettings_array = initApp.getSettings();
                if (getSettings_array)
                {
                    $('#getSettings_input').val(getSettings_array)
                }
                else
                {
                    $('#getSettings_input').val('<body> class is empty or nothing to return')
                }
            }

            $('[data-action="toggle"]').on('click', function()
            {
                ng_eventlog();
            });

            $('#pushSettings_btn').on('click', function()
            {
                ng_pushSettings();
            });

            $('#getSettings_btn').on('click', function()
            {
                ng_getSettings();
            });

            $('#ng_eventlog_clear').on('click', function()
            {
                ng_eventlog_clear();
            });

        </script>
    </body>
</html>
